Skip to content

QVAC-18613 infra: recognise verified label as explicit tier 1 in approval bot#2006

Closed
Proletter wants to merge 2 commits into
mainfrom
feat/QVAC-18613-approval-bot-verified-tier-1
Closed

QVAC-18613 infra: recognise verified label as explicit tier 1 in approval bot#2006
Proletter wants to merge 2 commits into
mainfrom
feat/QVAC-18613-approval-bot-verified-tier-1

Conversation

@Proletter

Copy link
Copy Markdown
Collaborator

⛔ Do not merge until #1997 is live. This PR depends on the verified label being meaningful — that's gated by the label-gate fan-out in #1997. Marked Draft until then.

🎯 What problem does this PR solve?

  • The tier-based approval bot defaulted to tier 1 if no tier2 label was present. With the verified label landing in QVAC-18612 infra: gate every secret-bearing workflow with label-gate #1997 as the explicit tier-1 security marker (per QVAC-18190), reviewers had no way to see why a PR was at tier 1 — implicit-default vs. explicitly-verified looked identical in the bot comment.

  • Per QVAC-18613 AC: the bot needs to recognise verified as the explicit tier-1 marker AND mention verified in the tier explanation, so reviewers can audit the gate decision without reading worker source.

📝 How does it solve it?

Single surgical change to .github/workflows/approval-check-worker.yml:

Labels on PR Tier Bot comment "Tier source"
neither tier1 default (no tier label applied)
verified only tier1 `verified` label applied (explicit tier 1)
tier2 only tier2 `tier2` label applied
both tier2 (stricter wins) `tier2` label applied (overrides `verified`)
  • Adds hasVerified / hasTier2 locals + a tierSource string threaded through checkTierRequirements and comment so the bot output mentions verified per AC add public reusable for qvac-cli #2.
  • Bot comment gains a **Tier source:** line right under **PR Tier:** so the source is visible without expanding logs.
  • Precedence rationale: tier2 wins when both labels are present — stricter requirements take priority on conflict. Documented inline in the worker.

Backwards compatibility: PRs with neither label keep the prior behaviour exactly. PRs with only tier2 keep the prior behaviour exactly. The only new code paths are verified-only and both-labels.

🧪 How was it tested?

  • actionlint clean on the modified workflow.
  • YAML parse + JS extract + node --check on the embedded actions/github-script body — clean.
  • Manual code review of the threading: tierSource present at every call site.

Pending live validation (to be performed before flipping out of Draft, after #1997 lands):

  • Open a throwaway PR.
  • Comment /review with no labels → bot says "Tier source: default (no tier label applied)" + tier 1 requirements.
  • Apply verified → bot updates to "Tier source: verified label applied (explicit tier 1)" + tier 1 requirements.
  • Apply tier2 (still has verified) → bot updates to "Tier source: tier2 label applied (overrides verified)" + tier 2 requirements.
  • Remove verified → bot updates to "Tier source: tier2 label applied" + tier 2 requirements (unchanged from previous behaviour).
  • Remove tier2 → back to "default" + tier 1.

🔗 Related

Made with Cursor

…oval bot

The tier-based approval check previously defaulted to tier 1 if no
\`tier2\` label was present, treating tier 1 as an implicit fallback.
Per QVAC-18190 the \`verified\` label landing in #1997 should also be
the explicit tier-1 marker, so reviewers can see in the bot comment
*why* a PR is at tier 1 (because it's verified, vs. because no tier
label is set).

Behaviour matrix (matches QVAC-18613 acceptance criteria):

| Labels on PR     | Tier  | Bot comment "Tier source"                          |
|------------------|-------|----------------------------------------------------|
| neither          | tier1 | default (no tier label applied)                    |
| \`verified\` only  | tier1 | \`verified\` label applied (explicit tier 1)         |
| \`tier2\` only     | tier2 | \`tier2\` label applied                              |
| both             | tier2 | \`tier2\` label applied (overrides \`verified\`)       |

Precedence rationale: \`tier2\` wins when both labels are present.
Stricter requirements take priority on conflict. The matrix above
is preserved verbatim in the bot comment so the reviewer can verify
the active rule without reading code.

Backwards compatibility: PRs with neither label keep the prior
behaviour exactly (tier 1 default, same requirements computation).
PRs with only \`tier2\` keep the prior behaviour exactly. The only
new code paths are the \`verified\`-only and both-labels cases.

Implementation:
- New \`hasVerified\` / \`hasTier2\` locals.
- New \`tierSource\` string threaded through
  \`checkTierRequirements\` and \`comment\` so the bot output mentions
  \`verified\` per AC #2.
- Bot comment gains a \`**Tier source:**\` line right under
  \`**PR Tier:**\` so the source is visible without expanding logs.

Validation plan:
- Marked draft pending #1997 (label-gate fan-out) merge so the
  \`verified\` label is actually applied in the wild.
- Test matrix walkthrough on a throwaway PR with each of the 4
  label combinations + \`/review\` comment to trigger the worker.
- Confirm the bot comment shows the expected "Tier source" string
  in each case and the requirementsMet decision is unchanged from
  the previous logic.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kinsta

kinsta Bot commented May 18, 2026

Copy link
Copy Markdown

Preview deployments for qvac-docs-staging ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: 9c7b2a04ddf7f4aaa97acebb30e4a5560bca3b85

Deployment ID: 721d623c-88f7-462b-b1d2-f19b032bc008

Static site name: qvac-docs-staging-fazwv

@Proletter Proletter marked this pull request as ready for review May 18, 2026 09:47
@Proletter Proletter requested review from a team as code owners May 18, 2026 09:47
@github-actions

Copy link
Copy Markdown
Contributor

Tier-based Approval Status

**PR Tier:** TIER1

**Current Status:** ❌ PENDING

**Requirements:**
- 1 Team Member approval ❌ (0/1)
- 1 Team Lead OR Management approval ❌ (0/1)



---
*This comment is automatically updated when reviews change.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant